package com.example.demo_controller;

import com.example.demo.MainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
public class AppController {

    @Autowired
    private MainService mainService;


    @GetMapping("/hello")
    public List<String> getstr() {
        return mainService.getstr();
    }

    @GetMapping("/hello1")
    public Pro getstrs() {
        return new Pro("aaa", 1, 1.1);
    }

    @GetMapping("/hello2")
    public Date getstrss() {
        return new Date();
    }
}


class Pro {
    String a;
    int b;
    double c;

    public Pro(String a, int b, double c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    @Override
    public String toString() {
        return "Pro{" +
                "a='" + a + '\'' +
                ", b=" + b +
                ", c=" + c +
                '}';
    }

    public String getA() {
        return a;
    }

    public void setA(String a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    public double getC() {
        return c;
    }

    public void setC(double c) {
        this.c = c;
    }
}
